/* 非异常失败：我要能找到合理的“错误” */

const user = {
  name: "Daniel",
  age: 26,
};

user.location;
// Error: Property 'location' does not exist on type '{ name: string; age: number; }'.

// 拼写错误=========================================================================
const announcement = "Hello World!";

// How quickly can you spot the typos?
announcement.toLocaleLowercase();
announcement.toLocalLowerCase();

// We probably meant to write this...
announcement.toLocaleLowerCase();

// 函数未被调用=======================================================================
function flipCoin() {
  // Meant to be Math.random()
  return Math.random < 0.5;
  // Error: Operator '<' cannot be applied to types '() => number' and 'number'.
}

// 基本逻辑错误=========================================================================
const value = Math.random() < 0.5 ? "a" : "b"
if (value !== 'a') {

} else if (value === "b") { 
  // Error: This comparison appears to be unintentional because the types '"a"' and '"b"' have no overlap.ts(2367)
}